angular.module('baisonWeather', ['baisonService'])
        .factory('dateDisplay', ['apiService', function (apiService) {
                return function(){
                    var date = new Date();
                    var weekday=new Array(7);
                    weekday[0]="星期天";
                    weekday[1]="星期一";
                    weekday[2]="星期二";
                    weekday[3]="星期三";
                    weekday[4]="星期四";
                    weekday[5]="星期五";
                    weekday[6]="星期六";
                    
                    var thistoday =weekday[date.getDay()];                
                    var seperator1 = "-";
                    var seperator2 = ":";
                    var month = date.getMonth() + 1;
                    var strDate = date.getDate();
                    if (month >= 1 && month <= 9) {
                        month = "0" + month;
                    }
                    if (strDate >= 0 && strDate <= 9) {
                        strDate = "0" + strDate;
                    }
                    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate + thistoday; 
                    return currentdate;
                };
            }])
		.factory('weatherDownload', ['apiService', function (apiService) {
                return function(){
                    return apiService('pos/weather/get_weather_by_city',{});
                };
            }])
        .factory('pictureDownload', ['apiService', function (apiService) {
                return function(){
                    return apiService('sys/params/get_img',{});
                };
            }])
        .factory('barcodesDownload',['apiService',function(apiService){
             return function(){
                   return apiService('sys/params/get_barcodes',{});
             };
        }]);
        